package com.atguigu.spzx.cloud.order.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;

//只能拦截feign的请求
@Component
public class FeignClientInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        //添加请求头
        template.header("token", UUID.randomUUID().toString().substring(0,6));
    }
}
